home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
fido
/
shelter191a.lha
/
rexx
/
Grab.WPLRX
< prev
next >
Wrap
Text File
|
1994-08-03
|
25KB
|
769 lines
/**/
v="$VER: GRAB Wplrx Roof Remote File Xfer Utility Williamson 54.55"
/* The number of requests permitted per call. Note some magic names */
/* may return more than one file. Each magic name is counted as one */
maxfiles=3
/* maximum number of files and sessions for a verified user */
maxpsessions=10
/* your list of files recd in last week */
newfiles="Mail:filelists/newfiles.lst"
/* help files for new users */
newinfo="Info:help/Grab"
/* TAGNAME of your SYSOP Feedback message base */
sysopbase=GetClip('SYSOPBASE')
/* Your name */
sysop=GetClip('SYSOP')
/* Verified user Data */
ucfg="CFG:Guser.dat"
/* Non-Secure Inbound directory for users */
indir=addslash(dequote(getclip('INDIR')))'USERS/'
/* If RFS is used instead of XfreqSh, maximum config and request */
/* accounting will take precedence over maxfiles setting */
rfs=1
ViewNew=0
/* if NOT using RFS */
freqcmd="run Xfreqsh >LOG:Freq.log CFG:FREQ.cfg"
options RESULTS
options failat 99
numeric digits 14
signal on syntax
signal on halt
signal on ioerr
signal on break_c
signal on break_d
pragma("W","NULL")
rpath=addslash(dequote(GetClip('REXXDIR')))
if ~show('L',"rexxsupport.library") then
if ~addlib("rexxsupport.library",0,-30,0) then do
say "Couldn't access support.library !"
exit 20
end
log=show('P','ROOFLOG')
/*rfshost=show('P','RFSHOST') */
mailer=GetCLip('SHELTER')
l_mailer=lower(mailer)
wplport=l_mailer
sv='v'right(v,5)
script="GRAB"
cls ='\014' /* WPL */
cr ='\r\n' /* WPL */
nl ='0a'X /* REXX */
bs ='08'x
quote='"'
tmsg="T:GRAB-"pragma('ID')
timeouts=0
parse arg baud port username
btarea=center("GRAB "sv,21)
btitle=center("A WPL Application by Robert Williamson",41)
call send(cls||cr||cr||center('GRAB File Requester 'sv' on $(host.sitename) Line 'port,80)||cr)
call send(" ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸ "cr)
call send(" ³°°°°°±±±±±²²²²²ÛÛÛÛÛ²²²²²³"btarea"³²²²²²ÛÛÛÛÛ²²²²²±±±±±°°°°°³ "cr)
call send(" ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ "cr)
call send(" ³°°°°°±±±±±²²²²²³"btitle"³²²²²²±±±±±°°°°°³ "cr)
call send(" ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; "cr||cr)
call send(" MAKE SURE your terminal program has the following protocol settings:"cr)
call send(" Zmodem CRC32 with AutoDownLoad ON and ADL Challenge ON."cr)
call send(" Do not waste time guessing filenames, requesting files that are not"cr)
call send(" in the FileList or which are larger than the allowable free bytes!"cr)
call send(" These are the requirements to GRAB files"cr)
if username="" then fname=wpl_prompt(60,cr' Please enter your name: ')
else fname=strip(username)
if fname="" | words(fname)<2 | index(fname,"'") ~=0 | index(fname,"`") ~=0 then do
call send(cr'Sorry, your first name and last name (sans apostrophes) is required to GRAB files'cr)
'Set USER FALSE'
call cleanup()
exit 0
end
xname='$(p.login) 'fname time()
'RexxMSG NY LOGPROC "PutLine 'l_mailer'wplstat$(line) 'xname'"'
tdomain=translate(fname,"_"," ");address="0:0/0.0"
user_verified=GetVar("VUSER"port,"G")=="TRUE"
call PutLog('Login:'fname tdomain"#"address 'Verified:'user_verified,10,10)
notgrabreq=1
if ~rfs then reqfile="0.0.0.0.REQ"
else do
reqfile=tdomain".GRAB"
if exists(indir||reqfile) then do
call send(cr' Found your request list'cr)
notgrabreq=0
end
if notgrabreq then do
AcctFile="LOG:RFSacct/h/"tdomain".0.0.0.0"
if ~exists(AcctFile) then do
call Send(' We have No account for you as yet 'fname||cr)
call Send(' Accounts are only created when you have made requests.'cr)
if upper(wpl_prompt(30,' Since your are a new user, would you like some more information? (Y/n) '))~="N" then call display_text(newinfo)
end;else do
call Send(' You can automate your GRAB sessions by uploading 'tdomain'.GRAB,'cr)
call Send(' containing the list of files you want, with the UL command.'cr)
end
end
if ~user_verified then do
if ~verify() then do
call PutLog(fname' declined verification',10,10)
user_verified=0
end;else do
maxfiles=maxpsessions
user_verified=1
end
end
if notgrabreq then call show_status()
'Set remote.address' tdomain"#"address
'SetA remote $(remote.address)'
'Set remote.network FIDO'
'BeginSession $(remote.address)'
'RexxMsg NY "LOGPROC" "PutLog 'l_mailer'wpl $<time> $(line) GRAB session with $(remote.address)"'
end
reqname=indir||reqfile
if notgrabreq then do
if ViewNew then do
if upper(wpl_prompt(30,' View new files received in the last week? (y/N) '))="Y" then call display_text(newfiles)
end
call send(' You can either Browse File Areas and Mark files for DownLoad or'cr)
call send(' Enter filenames if you know the exact names from the file list'cr)
dobrowse=upper(wpl_prompt(30,' [B]rowse or [E]nter? (b/E) '))=="B"
if dobrowse then do
if exists("RPDIR:BROWSE") then do
address COMMAND 'Browse' baud port availbytes fname
stat=RC
end;else if exists(rpath'browse.rexx') then do
address REXX rpath'browse.rexx' baud port availbytes fname
stat=RESULT
end;else do
call send('Sorry, Browse is not available at the moment'cr)
stat=1
end
call PutLog('Browse returned:'stat,10,10)
if stat>1 then do
call cleanup
exit
end;else if stat=1 then notgrabreq=0
else do
if upper(wpl_prompt(30,' You did not mark any files for download'CR' Do you wish to enter filenames? (Y/n)'))="N" then do
call send(' OK, bye'cr)
call cleanup
exit
end
end
end
end
rereq:
if notgrabreq then call getrequests
if lostcarrier('request entry') then exit
if ~notgrabreq then signal getfiles
getstate:
resp=upper(wpl_prompt(30,' [D]ownload, [R]e-enter requests, [A]bort Grab? '))
if resp="R" then signal rereq
else if resp="A" then do
call PutLog(fname 'aborted',10,10)
call send(cr||cr' -> Bye, sorry you did not find anything you wanted!'cr||cr)
call cleanup
exit
end
else if resp~="D" then signal getstate
getfiles:
if word(statef(reqname),2) ~= 0 then do
call send(cls||cr' Please WAIT, now searching for the files you have requested'cr)
call send(' You have a few seconds to MAKE SURE Zmodem is your default'cr)
call send(' protocol and that both AutoDownLoad and ADL Challenge are ON.'cr)
call send(' If you do not have these settings, the transfer will fail.'cr)
if rfs then do
host_address=GetClip('DOMAIN')"#"GetClip('HOST.ADDRESS.'GetClip('DOMAIN'))
address "REXX" rpath'RFS.rexx' wplport port baud host_address reqname user_verified tdomain'#'address fname
end;else do
cmd=freqcmd reqfile reqname tdomain'#'address port
address COMMAND cmd
end
call send(cr' Ready! 'cr)
if lostcarrier('during search') then exit
Address "LOGPROC" "PutLine 'l_mailer'wplstat"port protpos "ZMODEM"
call xfer()
dl=1
end;else do
call send(cr' No files requested'cr)
dl=0
end
if dl then resp=wpl_prompt(60,cr' Well 'fname', do you want to thank the sysop for these free downloads? y/N ')
else resp=wpl_prompt(60,cr' Well 'fname', do you want to leave the sysop a message? y/N ')
if upper(resp)="Y" then call feedback
call send(cr||cr' -> Bye!'cr||cr)
if ~dl then call PutLog('No requests from' fname,10,10)
call cleanup()
exit 0
getrequests:
call send(cls)
call send(' Enter filenames (maximum 'maxfiles', NO WILDCARDS!)'cr)
call send(' or a blank line to start transfer.'cr)
if ~Open('reqfile',reqname,'A') then do
if ~Open('reqfile',reqname,'W') then do
call PutLog("Error opening" reqname,10,10)
call cleanup
Exit 10
end
end
do n=1 to maxfiles
wantfile=wpl_prompt(60,cr' FILE 'n': ')
if wantfile="" then leave
if pos('*',wantfile)>0 then do
call send(' NO WILDCARDS!'cr)
if n>1 then n=n-1
iterate
end
else call WriteLN('reqfile',strip(wantfile))
call PutLog(fname 'requesting:'strip(wantfile),10,10)
end
call close('reqfile')
return
xfer:
t='GRAB $(protocol) Sending to 'fname
'Set req TRUE protocol ZMODEM inbound' indir
if ~rfs then do
'Set remote.address' tdomain"#"address
'BeginSession $(remote.address)'
end
'Set titadr' '"'t'"'
'RexxMsg NY "LOGPROC" "PutLog 'l_mailer'wpl $<time> $(line) GRAB sending files to $(remote.address)"'
'RexxMsg NY "LOGPROC" "PutLine 'l_mailer'wplstat$(line) $(p.protocol) $(protocol)"'
'SetMailerFlags' '"DN,PN"'
'XprSetup' 'xprzedzap.library' 'TN,ON,B8,F0,E30,AN,DN,KN,SN,RN,NN,M1024'
'SetUpDate "CON:0/$($(line).w_offset)/640/130/$(titadr)/AUTO/SCREEN$(pscreen)"'
'XprSend ""'
'RexxMsg NY "LOGPROC" "PutLog 'l_mailer'wpl $<time> $(line) GRAB $(remote.address) $(protocol) Send:$(RC)"'
'XprClose'
'SetUpDate NULL'
'RexxMsg NY "LOGPROC" "PutLog 'l_mailer'wpl $<time> $(line) GRAB $(remote.address) $(protocol) RC:$(RC)"'
'EndSession all'
return
display_text:
textfile=arg(1)
if ~open('tf',textfile,"R") then do
call Send(cr'Sorry, unable to find 'textfile||cr)
call PutLog("Cannot open "textfile,10,10)
return 0
end
call PutLog('Typing 'textfile' for 'fname,10,10)
call send(cls||cr)
lines=0
do while ~eof('tf')
if lostcarrier('during text display') then exit
call send(readln('tf')||cr)
lines=lines+1
if lines=24 then do
lines=0
if upper(wpl_prompt(60,cr'More(Y,n): '))="N" then do
call close('tf')
call send(cr)
return 0
end;else do
call send(copies(bs,12))
call send(cls)
end
end
end
call close('tf')
call send(cr)
return 0
show_status:
if ~open('rcfg',"RAM:RFS.CFG",'r') then
if ~open('rcfg',"CFG:RFS.CFG",'r') then return 0
call seek('rcfg',-512,'E')
do while ~eof('rcfg')
z=readln('rcfg')
if upper(left(word(z,1),3))="MAX" then interpret z
end
call close('rcfg')
call send(cls||cr)
AcctFile="LOG:RFSacct/h/"tdomain".0.0.0.0"
if ~exists(AcctFile) then do
call Send(' Opening new account for 'fname||cr)
call Send(' Account will be deleted if no requests made.'cr||cr)
FirstDate=date();LastDate=date()
NumReqs=0;ReqFiles=0;ReqBytes=0;LastBytes=0;UserCalls=1
limits="RESET"
if user_verified then do
availbytes=(baud*100)
availsessions=maxpsessions
end;else do
availbytes=MaxHBytes
availsessions=MaxCalls
end
end;else do
call open('Acct',AcctFile,'R')
FirstDate=readln('Acct')
LastDate =readln('Acct')
NumReqs =readln('Acct')
ReqFiles =readln('Acct')
ReqBytes =readln('Acct')
LastBytes=readln('Acct')
UserCalls=readln('Acct')
call close('Acct')
if Date()=LastDate then do
limits="ACTIVE"
if user_verified then do
availbytes=(baud*100)-LastBytes
availsessions=maxpsessions-UserCalls
end;else do
availbytes=MaxHDaily-LastBytes
availsessions=MaxCalls-UserCalls
end
end;else do
limits="RESET"
if user_verified then do
availbytes=(baud*100)
availsessions=maxpsessions
end;else do
availbytes=MaxHBytes
availsessions=MaxCalls
end
end
end
s12=copies(" ",12)
call send(s12' ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸'cr)
call send(s12' ³ Account :'right_justify(fname" ³",23)||cr)
call send(s12' ³ First Call :'right_justify(Firstdate" ³",23)||cr)
call send(s12' ³ Last Call :'right_justify(LastDate" ³",23)||cr)
call send(s12' ³ Number of Requests :'right_justify(NumReqs" ³",23)||cr)
call send(s12' ³ Files Transfered :'right_justify(ReqFiles" ³",23)||cr)
call send(s12' ³ Total Bytes Sent :'right_justify(ReqBytes" ³",23)||cr)
call send(s12' ³ Bytes Sent Last Call :'right_justify(LastBytes" ³",23)||cr)
call send(s12' ³ Number of Sessions :'right_justify(Usercalls" ³",23)||cr)
call send(s12' ³ Files available :'right_justify(maxfiles" ³",23)||cr)
call send(s12' ³ Bytes available :'right_justify(availbytes" ³",23)||cr)
call send(s12' ³ Remaining Sessions :'right_justify(availsessions" ³",23)||cr)
call send(s12' ³ Daily limits :'right_justify(limits" ³",23)||cr)
call send(s12' ³ Total Freeloader Limit :'right_justify(MaxHtotal" ³",23)||cr)
call send(s12' ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ;'cr||cr)
if ReqBytes>MaxHtotal then do
call send(s12' ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸'cr)
call send(s12' ³ FreeLoader Limit Exceeded - Time to REGISTER ³'cr)
call send(s12' ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ;'cr||cr)
call send(' Just look at what you are missing!'cr||cr)
call display_text(newfiles)
end
return
/* feedback to sysop */
feedback:
call PutLog('GRAB feedback from 'fname,10,10)
call send(cls||cr' To: 'sysop)
call send(cr' From: 'fname)
resp=wpl_prompt(60,cr' Subject (Return aborts): ')
if resp="" then do
call send(cr' Message aborted, why?'cr)
return 0
end
else subject=strip(resp)
call send(cr' Enter your message one line at a time.'cr)
call send(cr' Hit Return to select Save or continue.'cr)
call open('smsg',tmsg,"W")
call writech('smsg'," GRAB Feedback to Sysop "resp" from "fname" Posted:"date()" at "time()||nl)
editing=1
line=1
c=0
do while editing
do while resp ~= ""
if lostcarrier('during feedback') then leave
resp=wpl_prompt(200,"-->"line": ")
if resp ~= "" then do
chars=writech('smsg',resp||nl)
c=c+chars
line=line+1
end
end /* hit a blank line */
if lostcarrier('during feedback') then do
call writech('smsg',fname 'dropped carrier'nl)
call save_msg
exit
end
if upper(wpl_prompt(120,cr' You entered 'line-1' lines and 'chars' characters (total:'c'), [S]ave/[c]ontinue?'cr))="S" then editing=0
end /* finished editing */
call save_msg
call send(cr' Message saved, thanks' fname||cr)
return 0
save_msg:
call writech('smsg',nl)
call close('smsg')
call PutLog('Saving message from 'fname' in 'sysopbase,10,10)
call send(cr' Saving......')
if exists("RPDIR:Smsg") then do
cmd=sysopbase tmsg '"'fname'"' '"'sysop'"' subject
call PutLog('Executing:' cmd,10,10)
address COMMAND "run >NIL: Smsg" cmd
end;else do
cmd=rpath'Smsg.rexx' sysopbase tmsg '"'fname'"' '"'sysop'"' subject
call PutLog('Executing:' cmd,10,10)
Address "AREXX" cmd
end
address
return
lostcarrier:
'CheckCarrier'
if RC=0 then return 0
call PutLog(fname 'dropped carrier during 'arg(1),10,10)
call cleanup
return 1
send:
'Print' quote||arg(1)||quote
'Send' quote||arg(1)||quote
return
wpl_prompt:
'Print' quote||arg(2)||quote
'Send' quote||arg(2)||quote
getstring:
'GetInbound E0 'arg(1)
'String $(event)'
if upper(RESULT)='CARRIER' then do
'RexxMsg NY "LOGPROC" "PutLog 'l_mailer'wpl $<time> $(line) GRAB $(remote.address) Lost Carrier"'
call PutLog(fname' dropped carrier',10,10)
call cleanup
exit
end
if upper(RESULT)='TIMEOUT' then do
timeouts=timeouts+1
call Send(cr'Timeout:'timeouts' .....WakeUp!'cr)
if timeouts>3 then do
'RexxMsg NY "LOGPROC" "PutLog 'l_mailer'wpl $<time> $(line) GRAB $(remote.address) User Timeout"'
call PutLog(fname' fell asleep',10,10)
call Send(cr'Timeout EXIT, 'fname' fell asleep'cr)
call cleanup
exit
end
end
else if upper(RESULT)='LOGIN' then do
'String $(namebuf)'
x=(RESULT)
end
else x=""
return x
verify:
retries=3
if notgrabreq then do
call Send(cr" If you are a LOCAL caller and wish to be able to DL more than the"cr)
call Send(" prescribed limits, please enter your phone number. If you are a new user"cr)
call Send(" you will be asked to select an 8 character password. You MUST remember"cr)
call Send(" it, as it will be expected every time you use Grab's CBV."cr||cr)
call Send(" If you are a LONG-DISTANCE caller, and have made an arrangement with the"cr)
call Send(" Sysop, enter X instead of Y or N, and enter your password when asked."cr)
end
resp=upper(wpl_prompt(120," Do you wish to be verified? (Y/n) "))
if resp="X" then isdistant=1
else isdistant=0
if resp="N" then return 0
if isdistant then do
phonenumber=wpl_prompt(120," Enter access number: ")
if ~find_user(phonenumber) then do
call Send(" Invalid access number, sorry"cr)
return 0
end
if ~getpassword(password) then do
call send(cr||cr'Too bad'cr)
call PutLog(fname ' bad LD password',10,10)
'RexxMSG NY LOGPROC "PutLine 'l_mailer'wplstat$(line) $(p.password) BAD"'
call cleanup
exit
end;else do
status=fname' verified'
'RexxMSG NY LOGPROC "PutLine 'l_mailer'wplstat$(line) $(p.status)' status' $(p.password) OK"'
call PutLog(status,10,10)
return 1
end
end;else do
phonenumber=""
do i=1 to retries
resp=compress(wpl_prompt(120," Enter your local phone number: "),'- ')
if ~datatype(resp,'NUMERIC') then do
call Send(' Wierd number, 'retries-i' trys left'cr)
iterate
end
if length(resp)~=7 | substr(resp,2,2)="11" | left(resp,1)="0" then do
call Send(' Illegal, Invalid or Long Distance number, 'retries-i' trys left'cr)
iterate
end;else do
phonenumber=resp
leave
end
end
if phonenumber="" then do
call send(' You blew your chance!'cr)
call send(' You may still use GRAB, but you will limited in number of files'cr)
call send(' and total bytes you can download'cr)
return 0
end
if find_user(phonenumber) then call send(' If you have forgotten your password, leave me a NOTE with your phone number.'cr)
else do
call send(' Opening new user account'cr)
if ~set_password() then do
call send(' You blew your chance!'cr)
return 0
end
end
call Send(" The system will call you back in a few moments. Your should enable"cr)
call Send(" autoanswer with ATS0=1 or type ATA when you see the RING."cr)
call Send(" You must enter your password when asked."cr)
if upper(wpl_prompt(30," The system will now hangup and call you back at "phonenumber", OK? (Y/n) "))="N" then do
call send(' You blew your chance'cr)
return 0
end
pnum="ATDT"phonenumber"|"
do i=1 to retries
status='CBV Dialing 'fname', try:'i
'RexxMSG NY LOGPROC "PutLine 'l_mailer'wplstat$(line) $(p.status)' status '$(p.number)' phonenumber '$(p.response)"'
call PutLog(status,10,10)
call delay(60)
if mdmcmd(30,'$(hangupstring)','OK') then do
call delay(60)
if mdmcmd(5,'$(initstring)','OK') then do
call delay(60)
if mdmcmd(120,pnum,'CONNECT') then do
'ModemClear'
status='Reconnected to 'fname' on try 'i', getting password'
'RexxMSG NY LOGPROC "PutLine 'l_mailer'wplstat$(line) $(p.status)' status '$(p.response) CONNECT"'
call PutLog(status,10,10)
if ~getpassword(password) then do
call send(cr||cr'Too bad'cr)
call PutLog(fname ' bad password',10,10)
'RexxMSG NY LOGPROC "PutLine 'l_mailer'wplstat$(line) $(p.password) BAD"'
call cleanup
exit
end;else do
status=fname' verified'
'RexxMSG NY LOGPROC "PutLine 'l_mailer'wplstat$(line) $(p.status)' status' $(p.password) OK"'
call PutLog(status,10,10)
return 1
end
end;else do
'Print "No response to dial\n"'
iterate
end
end;else do
'Print "Cannot reinit\n"'
iterate
end
end;else do
'Print "Cannot hangup\n"'
iterate
end
end
call PutLog('Unable to contact 'fname' @ 'phonenumber,10,10)
if ~open('um',"LOG:RFSacct/h/"tdomain".0.0.0.0.m",'A') then do
if ~open('um',"LOG:RFSacct/h/"tdomain".0.0.0.0.m",'W') then do
call putlog('Unable to inform user',10,10)
call cleanup
exit 0
end
end
end
call writeln('um'," Call Back Verifier Report on "date()" at "time())
call writeln('um'," After three attempts, we were unable to connect with you at" phonenumber".")
call writeln('um'," Either the number given was incorrect or is Long Distance from this exchange.")
call writeln('um'," If you are a LONG-DISTANCE caller you may make an arrangement with the")
call writeln('um'," Sysop for a password to enable more generous limits.")
call close('um')
call PutLog('Posted failure to connect message to user',10,10)
call cleanup
exit 0
mdmcmd:
'Clear event lastresponse'
'ModemClear'
'SmartSend 'arg(2)
call delay(100)
'GetResponse' arg(1)
'String $(event)'
return(upper(RESULT)==arg(3))
getpassword:
'ModemClear'
call delay(60)
call send(cr||cr' CallBack Verifier 'sv||cr)
do i=1 to retries
if lostcarrier('password request') then exit
if upper(wpl_prompt(120," Password: "))~=arg(1) then call send(' Wrong, 'retries-i' trys left'cr)
else do
call send(' Ok!'cr)
call SetVar("VUSER"port,'TRUE',"G")
return 1
end
end
return 0
set_password:
call send(' You must select a password to use everytime you wish to be verified'cr)
call send(' If you forget your password, you will not get extended access'cr)
do i=1 to retries
password=""
if lostcarrier('new password request') then exit
resp=upper(wpl_prompt(120," Select an 8 character Password: "))
if length(resp) ~=8 then do
call send(' Invalid format, 'retries-i' trys left'cr)
call send(' User failed counting test'cr)
end;else do
password=strip(resp)
call delay(20)
if upper(wpl_prompt(120,' Ok, enter it again:'))~=password then do
call send(' Does not match!'cr)
call send(' User failed memory test.'cr)
iterate
end;else do
if ~open('u',ucfg,'A') then do
if ~open('u',ucfg,'W') then do
call PutLog('Unable to open 'ucfg,10,10)
call send(cr' System error'cr)
exit
end
end
call writeln('u',phonenumber password fname)
call close('u')
address COMMAND "Sort" ucfg ucfg
call PutLog(fname' @ 'phonenumber' selected a password',10,10)
call send(cr' Password accepted'cr)
call send(cr' Do not ever forget it!'cr)
return 1
end
end
end
return 0
find_user:
call delete("T:upw")
address COMMAND "Fsearch >t:upw" ucfg arg(1)
call open('p',"T:upw",'R')
udat=readln('p')
call close('p')
if left(udat,2)="!@" then return 0
parse VAR udat unum upw uname
if upper(uname)=upper(fname) then do
password=upw
return 1
end;else do
call send(copies(cr||cr' ***** ILLEGAL LOGIN *****'||'07'x||cr||cr,5))
call PutLog(fname' impersonating 'uname,10,10)
exit
end
return 0
/* get filename */
get_fn:
if LastPos('/',arg(1))~=0 then return SubStr(arg(1),LastPos('/',arg(1))+1)
else if LastPos(':',arg(1))~= 0 then return SubStr(arg(1),LastPos(':',arg(1))+1)
else return arg(1)
/* align text to right of field adding spaces or trucating on left to fit */
right_justify:
if length(arg(1))>arg(2) then return (right(arg(1),arg(2)))
else return (copies(" ",arg(2)-length(arg(1)))||arg(1))
PutLog: procedure expose log script
if ~log then do
'RexxMsg RN "LOGPROC" "Putlog 'l_mailer'wpl $<time> $(line) 'script':' arg(1)
end;else do
if arg(2) > GetClip('LOGLEVEL') then return 0
address 'ROOFLOG' 'logline' left(time(),5) script': 'arg(1)
address
end
return 0
addslash:
curr=arg(1)
select
when right(curr,1)=":" then nop
when right(curr,1)="/" then nop
otherwise curr=curr"/"
end
return curr
/* a useful procedure by Walt Sullivan */
dequote:
parse arg thing
parse var thing '"' unq_thing '"'
if unq_thing ~= "" then return unq_thing
return thing
lower:
return(bitor(arg(1),'20'x))
cleanup:
call delete(reqname)
call close('tf')
return 0
break_c:
break_d:
PutLog('User abort',10,10)
call cleanup
exit 10
novalue:
call template_oops "Novalue" sigl
syntax:
call template_oops "Syntax(RC=" RC ")" sigl RC
failure:
call template_oops "Failure(RC=" RC ")" sigl
ioerr:
call template_oops "IOErr" sigl
halt:
call template_oops "Halt" sigl
template_oops:
parse arg what badline code
if code ~= "" then PutLog('ERR: Line 'badline what errortext(code),10,10)
else PutLog('ERR: Line' badline what,10,10)
PutLog('ERR: Line 'badline':'strip(sourceline(badline)),10,10)
call cleanup
exit(40)
/**/